﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SmartSpace.Orgs;
using SmartSpace.Web;

namespace SmartSpace.WebApp.Modules.Orgs.Pages
{
    public partial class NodeType_Add : SsTemplatePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Save_NodeType(object sender, EventArgs e)
        {
            NodeType node = new NodeType();
            node.Id = Guid.NewGuid();
            node.Code = this.txt_code.Text;
            node.Caption = this.txt_caption.Text;
            node.IsPost = this._ctlCheckPost.Checked;

            OrgsService services = new OrgsService();
            ServiceResult result = services.SaveType(node);

            if (result.IsSuccess)
            {
                Response.Redirect("NodeType-List.aspx");
            }
        }

    }
}